package com.luguangtao.controller;

import com.github.pagehelper.PageInfo;
import com.luguangtao.api.ClientApi;
import com.luguangtao.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @类名: com.luguangtao.controller
 * @作者: lgt
 * @创建时间: 2019-12-09 09:18
 * @描述:
 **/
@RestController
@CrossOrigin
public class ClientController2 {
    @Autowired
    ClientApi clientApi;

    //登录
    @RequestMapping("login")
    public String login(String username,String password){
        String s = clientApi.login1(username, password);
        return s;
    }

    //注册
    @RequestMapping("regist")
    public int regist(User user){
        int bb = clientApi.regist1(user);
        return bb;
    }

    //列表
    @RequestMapping("lists")
    public PageInfo<User> lists(Integer pageNum,Integer pageSize,String names){
        PageInfo<User> info = clientApi.lists1(pageNum, pageSize, names);
        return info;
    }
}
